<template>
    <div class="vote-wrapper container-channel">
        <p class="status text-center">投票活动已结束</p>
        <div class="panel">
            <div class="panel-header">投票活动详情 <i class="icon van-icon van-icon-arrow"></i></div>
            <div class="panel-body">
            <ul class="vote-list">
                <li
                v-for="item in voteLists"
                :key="item.id"
                @click="toggleChecked(item)"
                ><span class="modal-checkbox" :class="{'active': item.checked}"></span>{{item.checked}}{{item.name}}</li>
            </ul>
            </div>
            <div class="panel-option">
            <button type="button" class="button-block">活动已结束</button>
            </div>
        </div>
    </div>
</template>

<script>
export default {
  components: {},
  props: {
      votes: {
          type: Object,
          default: {}
      }
  },
  data() {
    return {
    };
  },
  computed: {
      voteLists(){
          return JSON.parse(JSON.stringify(this.votes));
      }
  },
  methods: {
    toggleChecked(item){
      this.votes.find((item)=>item.id).checked = item.checked;
      // console.log(item)
      // item.checked = !item.checked;
    }
  },
  created() {},
  mounted() {}
};
</script>
<style lang="scss" scoped>
// 投票活动
.vote-wrapper {
  height: 100%;
  padding-bottom: 40px;
  .status {
    height: 60px;
    font-size: 26px;
    line-height: 60px;
    color: #000;
    background-color: rgba(0,0,0,.5);
  }

  .panel {
    height: calc(100% - 60px);
    padding: 0 32px;
    background-color: #fff;
  }

  .panel-header {
    height: 82px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 28px;
    line-height: 80px;
    color: #2a2a2a;
    position: relative;
    .icon {
      position: absolute;
      right: 0;
      top: 50%;
      transform: translate3d(0, -50%, 0);
    }
  }

  .panel-body{
    height: calc(100% - 80px - 140px);
  }

  .vote-list {
    li {
      height: 96px;
      font-size: 28px;
      line-height: 96px;
      color: #2a2a2a;
    }
  }


  .panel-option{
    padding: 0 40px;
  }

  .button-block {
    display: block;
    width: 100%;
    height: 80px;
    font-size: 32px;
    color:#666;
    line-height: 80px;
    text-align: center;
    border-radius: 40px;
    &.disabled {
      background-color: #ccc;
    }
  }

    .modal-checkbox {
        margin-right: 20px;
        vertical-align: middle;
        position: relative;
        top: -1px;
    }

}
</style>